clc;
clear;

left = -1;
right = 1;
bottom = -1;
top = 1;
Nx = 2;
Ny = 2;
hx = (right-left)/Nx;
hy = (top-bottom)/Ny;
h_partition = [hx, hy];
basis_type = 1;

uh = poisson_solver_triangle(left, right, bottom, top, h_partition, basis_type);

x = linspace(left, right, Nx+1);
y = linspace(bottom, top, Ny+1);
[X, Y] = meshgrid(x, y);
z = reshape(uh, [Nx+1,Ny+1]);

figure;
subplot(1, 2, 1);
surf(X, Y, z);
xlabel('X');
ylabel('Y');
zlabel('uh');
title('数值解');
subplot(1, 2, 2);
surf(X, Y, exact_solution(X,Y))
xlabel('X');
ylabel('Y');
zlabel('exact');
title('精确解');

check_FE_solution_error_triangle_linear
% check_FE_solution_error_triangle_quadratic